#ifndef _XMLPARSER_H_
#define _XMLPARSER_H_

#include <vector>
#include <string>
#include <map>
#include <QtXml/QDomDocument>
#include <QFile>
#include "Pokemon.h"
#include "pokemonException.h"

class XMLParser
{
public:
	XMLParser(const std::string &filename);
	~XMLParser();
	std::map<QString, Pokemon> getPokemons();

private:
	XMLParser() {}
	XMLParser(const XMLParser &) {}
      	XMLParser &operator=(const XMLParser &a);
	QDomDocument getDomDocument();
	void getRecursiveNodes(QDomNode &n, Pokemon &pkmn);
	void fillPokemon(const QString &node, const QString &content, Pokemon &pkmn);
	QDomDocument doc;
	const std::string file;
	std::map<QString, Pokemon> s_list;
	void fillMoves(QDomNode n3, Pokemon &pkmn);
	void fillStats(QDomNode n3, Pokemon &pkmn);
	void fillEvolutions(QDomNode n3, Pokemon &pkmn);
	void fillRatios(QDomNode n3, Pokemon &pkmn);
};

#endif